package com.wondertek.poms.pre.message;

import java.util.HashMap;

/**
 * <p><b>MessageCodes Description:</b> 6位数字标记消息，前两位表示系统，中间两位表示模块，后两位消息编码
 * 统一编码 880000 开始
 *
 * @author w2c
 * <b>DATE</b> 2015年9月4日 上午10:30:03
 */
public class MessageCodes {

    /**
     * 请求失败
     */
    public final static int M880000 = 880000;
    /**
     * 请求成功
     */
    public final static int M880001 = 880001;
    /**
     * 添加成功
     */
    public final static int M880002 = 880002;
    /**
     * 修改成功
     */
    public final static int M880003 = 880003;
    /**
     * 上传成功
     */
    public final static int M880004 = 880004;
    /**
     * 删除成功
     */
    public final static int M880005 = 880005;
    /**
     * 登录成功
     */
    public final static int M880006 = 880006;
    /**
     * 注册成功
     */
    public final static int M880007 = 880007;
    /**
     * 邮件发送成功
     */
    public final static int M880008 = 880008;
    /**
     * 用户未登录
     */
    public final static int M880009 = 880009;
    /**
     * 没有权限
     */
    public final static int M880010 = 880010;
    /**
     * 查找的对象不存在
     */
    public final static int M880011 = 880011;
    /**
     * 用户登录名或密码错误
     */
    public final static int M880012 = 880012;
    /**
     * 原密码错误
     */
    public final static int M880013 = 880013;
    /**
     * isRepeat方法验证数据重复
     */
    public final static int M880014 = 880014;
    /**
     * poms同步开关关闭
     */
    public final static int M880015 = 880015;
    
    private static HashMap<Integer, String> messageMap;

    static {
        messageMap = new HashMap<>();
        messageMap.put(880000, "请求失败");
        messageMap.put(880001, "请求成功");
        messageMap.put(880002, "添加成功");
        messageMap.put(880003, "修改成功");
        messageMap.put(880004, "上传成功");
        messageMap.put(880005, "删除成功");
        messageMap.put(880006, "登录成功");
        messageMap.put(880007, "注册成功");
        messageMap.put(880008, "邮件发送成功");
        messageMap.put(880009, "用户未登录");
        messageMap.put(880010, "没有权限");
        messageMap.put(880011, "查找的对象不存在");
        messageMap.put(880012, "用户登录名或密码错误");
        messageMap.put(880013, "原密码错误");
        messageMap.put(880014, "数据重复");
        messageMap.put(880015, "poms同步开关关闭");
    }

    public static String get(int index) {
        return messageMap.get(index);
    }
}
